// Copyright (C) 2025, ZWSOFT Co., LTD.(Guangzhou)
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.Extensions.DependencyInjection;
using System.Windows;
using TestClient.Domain;
using TestClient.ViewModel;

namespace TestClient
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public IServiceProvider? Services { get; private set; }

        protected override void OnStartup(StartupEventArgs e)
        {
            Services = ConfigureServices();
            base.OnStartup(e);
        }

        private static ServiceProvider ConfigureServices()
        {
            var services = new ServiceCollection()
            .AddSingleton<ISnackNotifyService, SnackNotifyService>()
            .AddSingleton<VFAdapterWrapper>()

            .AddTransient<HomeViewModel>()
            .AddTransient<CommentTestViewModel>()
            .AddTransient<ConnectionTestViewModel>()
            .AddTransient<CurveDivisionTestViewModel>()
            .AddTransient<CurveIntersectTestViewModel>()
            .AddTransient<CurveOperationTestViewModel>()
            .AddTransient<DbTestViewModel>()
            .AddTransient<ExportTestViewModel>()
            .AddTransient<GeodesicTestViewModel>()
            .AddTransient<HighlightTestViewModel>()
            .AddTransient<InquireTestViewModel>()
            .AddTransient<IntersectionTestViewModel>()
            .AddTransient<LoopCurveOpsTestViewModel>()
            .AddTransient<LoopOperationTestViewModel>()
            .AddTransient<MBDTestViewModel>()
            .AddTransient<MultipleDeletionTestViewModel>()
            .AddTransient<OffsetTestViewModel>()
            .AddTransient<PlyDartTestViewModel>()
            .AddTransient<PlySectionTestViewModel>()
            .AddTransient<PointInquireTestViewModel>()
            .AddTransient<PrimitiveTestViewModel>()
            .AddTransient<ProjectionTestViewModel>()
            .AddTransient<SelectionTestViewModel>()
            .AddTransient<SketchTestViewModel>()
            .AddTransient<SurfaceSewTestViewModel>()
            .AddTransient<TangentTestViewModel>()
            .AddTransient<TrimTestViewModel>()
            .AddTransient<MainWindowViewModel>()
            ;

            return services.BuildServiceProvider();
        }
    }

}
